<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>
        // 百鸡百钱
        //  100买100只鸡
        //  公鸡5   母鸡3   小鸡3只一块

        for(var i = 0 ; i <= 20 ; i++) {
            for(var j = 0 ; j <= 33 ; j++) {
                for(var k = 0 ; k <= 100 ; k++) {
                    if(i + j + k === 100 && i * 5 + j * 3 + k / 3 === 100) {
                        document.write(i + '只公鸡' + j + '只母鸡' + k + '只小鸡<br>');
                    }
                }
            }
        }

    </script>
    
</body>
</html>